<?php 
class Router { 
// +----------------------------------------------------------------------
// | 云端软件
// +----------------------------------------------------------------------
// | Copyright (c) 2015 yunduansoft.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 倪银龙 <niyinlong@126.com>
// +----------------------------------------------------------------------
	//路由类获取用户调用的类和函数
	public function getRouter() { 
		if (isset($_SERVER['PATH_INFO']))
			$query_string = substr(str_replace(array('.html','.htm', '.php', '//'), '',$_SERVER['PATH_INFO']),1); 
		else 
			$query_string = str_replace($_SERVER['SCRIPT_NAME'], '',$_SERVER['PHP_SELF']); 
		$temp = explode('/', $query_string,3);   
		if ( empty($temp[0]) ) 
		 	$temp[0] = 'Index'; //默认类为Index
		if ( empty($temp[1]) ) 
			$temp[1] = 'index'; //默认操作函数为index 
		$router = array();
		$router[0] = $temp[0];
		$router[1] = $temp[1];
		return $router;
	}
} 
?> 